<extend name="Space/index" />
<block name="main">
<div id="wp" class="wp">
	<div id="pt" class="bm cl">
		<div class="z">
			<a href="http://www.miui.com/index.php" class="nvhm" title="首页">MIUI论坛</a><em>›</em>
			<a href="http://www.miui.com/home.php?mod=spacecp">设置</a><em>›</em>个人资料
		</div>
	</div>
	<div id="ct" class="ct2_a wp cl">
		<div class="mn">
			<div class="bm bw0">
				<h1 class="mt">个人资料
				</h1>
				<!--don't close the div here-->
				<ul class="tb2 cl">
					<li class="a"><a href="http://www.miui.com/home.php?mod=spacecp&ac=profile&op=base">基本资料</a></li>
					
				</ul>
				<iframe id="frame_profile" name="frame_profile" style="display: none">
				</iframe>
				<form action="<{:U('Space/ziliaoedit')}>" method="post" enctype="multipart/form-data">
					<!--<input value="4badb16e" name="formhash" type="hidden">-->
					<table class="tfm" id="profilelist" cellpadding="0" cellspacing="0">
					<tbody>
					<tr>
						<th class="profile_item">
							用户名
						</th>
						<td class="profile_uname">
							<{$username}>
						</td>
						<td>
							 
						</td>
					</tr>
					<tr id="tr_field4">
						<th id="th_field4" class="profile_item">
							年龄
						</th>
						<td id="td_field4">
							<input name="age" id="field4" class="px" tabindex="1" type="text" value="<{$data.age}>">
							<div class="rq mtn" id="showerror_field4">
							</div>
						</td>	
					</tr>
					<tr id="tr_gender">
						<th id="th_gender" class="profile_item">
							性别
						</th>
						<td id="td_gender">
							<div class="ftid_spacecp_levels">
								<label><input type="radio" name="sex" value="1" <if condition="$data.sex eq '1'">checked</if>>男</label>
								<label><input type="radio" name="sex" value="0" <if condition="$data.sex eq '0'">checked</if>>女</label>
								<label><input type="radio" name="sex" value="2" <if condition="$data.sex eq '2'">checked</if>>保密</label>

							</div>
							<div class="rq mtn" id="showerror_gender">
							</div>
							<p class="d">
							</p>
						</td>
						
					</tr>
					<tr id="tr_birthday">
						<th id="th_birthday" class="profile_item">
							生日
						</th>
						<td id="td_birthday">
							<div class="ftid_spacecp_prav" style="float:left">
								<select name="year">
									<option value="1918" <if condition="$data.year eq '1918'">selected</if>>1918</option>
									<option value="1919" <if condition="$data.year eq '1919'">selected</if>>1919</option>
									<option value="1920" <if condition="$data.year eq '1920'">selected</if>>1920</option>
									<option value="1921" <if condition="$data.year eq '1921'">selected</if>>1921</option>
									<option value="1922" <if condition="$data.year eq '1922'">selected</if>>1922</option>
									<option value="1923" <if condition="$data.year eq '1923'">selected</if>>1923</option>
									<option value="1924" <if condition="$data.year eq '1924'">selected</if>>1924</option>
									<option value="1925" <if condition="$data.year eq '1925'">selected</if>>1925</option>
									<option value="1926" <if condition="$data.year eq '1926'">selected</if>>1926</option>
									<option value="1927" <if condition="$data.year eq '1927'">selected</if>>1927</option>
									<option value="1928" <if condition="$data.year eq '1928'">selected</if>>1928</option>
									<option value="1929" <if condition="$data.year eq '1929'">selected</if>>1929</option>
									<option value="1930" <if condition="$data.year eq '1930'">selected</if>>1930</option>
									<option value="1931" <if condition="$data.year eq '1931'">selected</if>>1931</option>
									<option value="1932" <if condition="$data.year eq '1932'">selected</if>>1932</option>
									<option value="1933" <if condition="$data.year eq '1933'">selected</if>>1933</option>
									<option value="1934" <if condition="$data.year eq '1934'">selected</if>>1934</option>
									<option value="1935" <if condition="$data.year eq '1935'">selected</if>>1935</option>
									<option value="1936" <if condition="$data.year eq '1936'">selected</if>>1936</option>
									<option value="1937" <if condition="$data.year eq '1937'">selected</if>>1937</option>
									<option value="1938" <if condition="$data.year eq '1938'">selected</if>>1938</option>
									<option value="1939" <if condition="$data.year eq '1939'">selected</if>>1939</option>
									<option value="1940" <if condition="$data.year eq '1940'">selected</if>>1940</option>
									<option value="1941" <if condition="$data.year eq '1941'">selected</if>>1941</option>
									<option value="1942" <if condition="$data.year eq '1942'">selected</if>>1942</option>
									<option value="1943" <if condition="$data.year eq '1943'">selected</if>>1943</option>
									<option value="1944" <if condition="$data.year eq '1944'">selected</if>>1944</option>
									<option value="1945" <if condition="$data.year eq '1945'">selected</if>>1945</option>
									<option value="1946" <if condition="$data.year eq '1946'">selected</if>>1946</option>
									<option value="1947" <if condition="$data.year eq '1947'">selected</if>>1947</option>
									<option value="1948" <if condition="$data.year eq '1948'">selected</if>>1948</option>
									<option value="1949" <if condition="$data.year eq '1949'">selected</if>>1949</option>
									<option value="1950" <if condition="$data.year eq '1950'">selected</if>>1950</option>
									<option value="1951" <if condition="$data.year eq '1951'">selected</if>>1951</option>
									<option value="1952" <if condition="$data.year eq '1952'">selected</if>>1952</option>
									<option value="1953" <if condition="$data.year eq '1953'">selected</if>>1953</option>
									<option value="1954" <if condition="$data.year eq '1954'">selected</if>>1954</option>
									<option value="1955" <if condition="$data.year eq '1955'">selected</if>>1955</option>
									<option value="1956" <if condition="$data.year eq '1956'">selected</if>>1956</option>
									<option value="1957" <if condition="$data.year eq '1957'">selected</if>>1957</option>
									<option value="1958" <if condition="$data.year eq '1958'">selected</if>>1958</option>
									<option value="1959" <if condition="$data.year eq '1959'">selected</if>>1959</option>
									<option value="1960" <if condition="$data.year eq '1960'">selected</if>>1960</option>
									<option value="1961" <if condition="$data.year eq '1961'">selected</if>>1961</option>
									<option value="1962" <if condition="$data.year eq '1962'">selected</if>>1962</option>
									<option value="1963" <if condition="$data.year eq '1963'">selected</if>>1963</option>
									<option value="1964" <if condition="$data.year eq '1964'">selected</if>>1964</option>
									<option value="1965" <if condition="$data.year eq '1965'">selected</if>>1965</option>
									<option value="1966" <if condition="$data.year eq '1966'">selected</if>>1966</option>
									<option value="1967" <if condition="$data.year eq '1967'">selected</if>>1967</option>
									<option value="1968" <if condition="$data.year eq '1968'">selected</if>>1968</option>
									<option value="1969" <if condition="$data.year eq '1969'">selected</if>>1969</option>
									<option value="1970" <if condition="$data.year eq '1970'">selected</if>>1970</option>
									<option value="1971" <if condition="$data.year eq '1971'">selected</if>>1971</option>
									<option value="1972" <if condition="$data.year eq '1972'">selected</if>>1972</option>
									<option value="1973" <if condition="$data.year eq '1973'">selected</if>>1973</option>
									<option value="1974" <if condition="$data.year eq '1974'">selected</if>>1974</option>
									<option value="1975" <if condition="$data.year eq '1975'">selected</if>>1975</option>
									<option value="1976" <if condition="$data.year eq '1976'">selected</if>>1976</option>
									<option value="1977" <if condition="$data.year eq '1977'">selected</if>>1977</option>
									<option value="1978" <if condition="$data.year eq '1978'">selected</if>>1978</option>
									<option value="1979" <if condition="$data.year eq '1979'">selected</if>>1979</option>
									<option value="1980" <if condition="$data.year eq '1980'">selected</if>>1980</option>
									<option value="1981" <if condition="$data.year eq '1981'">selected</if>>1981</option>
									<option value="1982" <if condition="$data.year eq '1982'">selected</if>>1982</option>
									<option value="1983" <if condition="$data.year eq '1983'">selected</if>>1983</option>
									<option value="1984" <if condition="$data.year eq '1984'">selected</if>>1984</option>
									<option value="1985" <if condition="$data.year eq '1985'">selected</if>>1985</option>
									<option value="1986" <if condition="$data.year eq '1986'">selected</if>>1986</option>
									<option value="1987" <if condition="$data.year eq '1987'">selected</if>>1987</option>
									<option value="1988" <if condition="$data.year eq '1988'">selected</if>>1988</option>
									<option value="1989" <if condition="$data.year eq '1989'">selected</if>>1989</option>
									<option value="1990" <if condition="$data.year eq '1990'">selected</if>>1990</option>
									<option value="1991" <if condition="$data.year eq '1991'">selected</if>>1991</option>
									<option value="1992" <if condition="$data.year eq '1992'">selected</if>>1992</option>
									<option value="1993" <if condition="$data.year eq '1993'">selected</if>>1993</option>
									<option value="1994" <if condition="$data.year eq '1994'">selected</if>>1994</option>
									<option value="1995" <if condition="$data.year eq '1995'">selected</if>>1995</option>
									<option value="1996" <if condition="$data.year eq '1996'">selected</if>>1996</option>
									<option value="1997" <if condition="$data.year eq '1997'">selected</if>>1997</option>
									<option value="1998" <if condition="$data.year eq '1998'">selected</if>>1998</option>
									<option value="1999" <if condition="$data.year eq '1999'">selected</if>>1999</option>
									<option value="2000" <if condition="$data.year eq '2000'">selected</if>>2000</option>
									<option value="2001" <if condition="$data.year eq '2001'">selected</if>>2001</option>
									<option value="2002" <if condition="$data.year eq '2002'">selected</if>>2002</option>
									<option value="2003" <if condition="$data.year eq '2003'">selected</if>>2003</option>
									<option value="2004" <if condition="$data.year eq '2004'">selected</if>>2004</option>
									<option value="2005" <if condition="$data.year eq '2005'">selected</if>>2005</option>
									<option value="2006" <if condition="$data.year eq '2006'">selected</if>>2006</option>
									<option value="2007" <if condition="$data.year eq '2007'">selected</if>>2007</option>
									<option value="2008" <if condition="$data.year eq '2008'">selected</if>>2008</option>
									<option value="2009" <if condition="$data.year eq '2009'">selected</if>>2009</option>
									<option value="2010" <if condition="$data.year eq '2010'">selected</if>>2010</option>
									<option value="2011" <if condition="$data.year eq '2011'">selected</if>>2011</option>
									<option value="2012" <if condition="$data.year eq '2012'">selected</if>>2012</option>
									<option value="2013" <if condition="$data.year eq '2013'">selected</if>>2013</option>
									<option value="2014" <if condition="$data.year eq '2014'">selected</if>>2014</option>
									<option value="2015" <if condition="$data.year eq '2015'">selected</if>>2015</option>
									<option value="2016" <if condition="$data.year eq '2016'">selected</if>>2016</option>
								</select>
								<a initialized="true" id="birthyear_ctrl" style="width:70px" tabindex="1">年</a>
							</div>
							  
							<div class="ftid_spacecp_levels" style="float:left">
								<select name="month">
									<option value="1" <if condition="$data.year eq '1'">selected</if>>1</option>
									<option value="2" <if condition="$data.year eq '2'">selected</if>>2</option>
									<option value="3" <if condition="$data.year eq '3'">selected</if>>3</option>
									<option value="4" <if condition="$data.year eq '4'">selected</if>>4</option>
									<option value="5" <if condition="$data.year eq '5'">selected</if>>5</option>
									<option value="6" <if condition="$data.year eq '6'">selected</if>>6</option>
									<option value="7" <if condition="$data.year eq '7'">selected</if>>7</option>
									<option value="8" <if condition="$data.year eq '8'">selected</if>>8</option>
									<option value="9" <if condition="$data.year eq '9'">selected</if>>9</option>
									<option value="10" <if condition="$data.year eq '10'">selected</if>>10</option>
									<option value="11" <if condition="$data.year eq '11'">selected</if>>11</option>
									<option value="12" <if condition="$data.year eq '12'">selected</if>>12</option>
								</select>
								<a href="javascript:;" id="birthmonth_ctrl" style="width:70px" tabindex="1">月</a>
							</div>
							  
							<div class="ftid_spacecp_levels">
								<select name="day">
									<option value="1" <if condition="$data.year eq '1'">selected</if>>1</option>
									<option value="2" <if condition="$data.year eq '2'">selected</if>>2</option>
									<option value="3" <if condition="$data.year eq '3'">selected</if>>3</option>
									<option value="4" <if condition="$data.year eq '4'">selected</if>>4</option>
									<option value="5" <if condition="$data.year eq '5'">selected</if>>5</option>
									<option value="6" <if condition="$data.year eq '6'">selected</if>>6</option>
									<option value="7" <if condition="$data.year eq '7'">selected</if>>7</option>
									<option value="8" <if condition="$data.year eq '8'">selected</if>>8</option>
									<option value="9" <if condition="$data.year eq '9'">selected</if>>9</option>
									<option value="10" <if condition="$data.year eq '10'">selected</if>>10</option>
									<option value="11" <if condition="$data.year eq '11'">selected</if>>11</option>
									<option value="12" <if condition="$data.year eq '12'">selected</if>>12</option>
									<option value="13" <if condition="$data.year eq '13'">selected</if>>13</option>
									<option value="14" <if condition="$data.year eq '14'">selected</if>>14</option>
									<option value="15" <if condition="$data.year eq '15'">selected</if>>15</option>
									<option value="16" <if condition="$data.year eq '16'">selected</if>>16</option>
									<option value="17" <if condition="$data.year eq '17'">selected</if>>17</option>
									<option value="18" <if condition="$data.year eq '18'">selected</if>>18</option>
									<option value="19" <if condition="$data.year eq '19'">selected</if>>19</option>
									<option value="20" <if condition="$data.year eq '20'">selected</if>>20</option>
									<option value="21" <if condition="$data.year eq '21'">selected</if>>21</option>
									<option value="22" <if condition="$data.year eq '22'">selected</if>>22</option>
									<option value="23" <if condition="$data.year eq '23'">selected</if>>23</option>
									<option value="24" <if condition="$data.year eq '24'">selected</if>>24</option>
									<option value="25" <if condition="$data.year eq '25'">selected</if>>25</option>
									<option value="26" <if condition="$data.year eq '26'">selected</if>>26</option>
									<option value="27" <if condition="$data.year eq '27'">selected</if>>27</option>
									<option value="28" <if condition="$data.year eq '28'">selected</if>>28</option>
									<option value="29" <if condition="$data.year eq '29'">selected</if>>29</option>
									<option value="30" <if condition="$data.year eq '30'">selected</if>>30</option>
									<option value="31" <if condition="$data.year eq '31'">selected</if>>31</option>
								</select>
								<a href="javascript:;" id="birthday_ctrl" style="width:70px" tabindex="1">日</a>
							</div>
							<div class="rq mtn" id="showerror_birthday">
							</div>
							<p class="d">
							</p>
						</td>
						
					</tr>
					<tr id="tr_realname">
						<th id="th_realname" class="profile_item">
							真实姓名
						</th>
						<td id="td_realname">
							<input name="realname" id="realname" class="px" tabindex="1" type="text" value="<{$data.realname}>">
							<div class="rq mtn" id="showerror_realname">
							</div>
							<p class="d">
							</p>
						</td>
						
					</tr>
					<tr id="tr_birthcity">
						<th id="th_birthcity" class="profile_item">
							现居地
						</th>
						<td id="td_birthcity">
							<div class="ftid_spacecp_level2">
								<div id="birthdistrictbox">
									<div class="ftid_spacecp_level3" style="display:inline-block;">
										<script src="__PUBLIC__/Home/js/jquery-1.8.3.min.js"></script>
										<select id="pro" name="pro"></select>
								        <select id="city" name="city"></select>
								        <select id="area" name="area"></select>
								        <select id="street" name="street"></select>


								    <script>
								        //获取省份的数据
								        $.ajax({
								            type:'get',
								            url:"<{:U('Space/address')}>",
								            async:false,
								            success:function(data){
								                //将省份信息 追加到 下拉框中
								                //先清空原先的数据
								                $('#pro').empty();
								                //遍历省份数据
								                for (var i = 0; i < data.length; i++) {
								                    $('<option value="'+data[i].id+'">'+data[i].name+'</option>').appendTo('#pro');
								                };
								            },
								            dataType:'json',
								        })

								        //绑定事件
								        $('#pro,#city,#area').change(function(){
								            var upid = $(this).val();
								            console.log(upid);
								            //清空之前的所有数据
								            $(this).nextAll('select').empty();
								            //保留 $(this) 的值
								            var _this = $(this);

								            //请求下一级的数据
								            $.ajax({
								                type:'get',
								                url:"<{:U('Space/address')}>",
								                data:"upid="+upid,
								                success:function(data){
								                    //如果下一级没有数据,就隐藏后面的下拉框
								                    if (!data) {
								                        _this.nextAll('select').hide();
								                        return;
								                    }

								                    // console.log(_this);
								                    // 填充下一级的数据
								                    for (var i = 0; i < data.length; i++) {
								                        $('<option value="'+data[i].id+'">'+data[i].name+'</option>').appendTo(_this.next('select'));
								                    }
								                    //自动触发 后面的select 的change事件
								                    _this.next('select').trigger('change');
								                },
								                dataType:'json',
								            })
								        })

								        //自动触发 #pro 的change
								        $('#pro').trigger('change');

								    </script>
									</div>
									  
								</div>
								<div class="rq mtn" id="showerror_birthcity">
								</div>
								<p class="d">
								</p>
							</div>
						</td>
						
					</tr>
					<tr id="tr_field6">
						<th id="th_field6" class="profile_item">
							E-mail
						</th>
						<td id="td_field6">
							<input name="email" id="field6" class="px" tabindex="1" type="email" value="<{$data.email}>">
							<div class="rq mtn" id="showerror_field6">
							</div>
							<p class="d">
							</p>
						</td>
					</tr>
					<tr id="tr_lookingfor">
						<th id="th_lookingfor" class="profile_item">
							交友目的
						</th>
						<td id="td_lookingfor">
							<input name="lookingfor" id="lookingfor" class="px" tabindex="1" type="text" value="<{$data.lookingfor}>">
							<div class="rq mtn" id="showerror_lookingfor">
							</div>
							<p class="d">
							</p>
						</td>
						
					</tr>
					<tr id="tr_interest">
						<th id="th_interest" class="profile_item">
							兴趣爱好
						</th>
						<td id="td_interest">
							<textarea name="interest" id="interest" class="pt" rows="3" cols="40" tabindex="1" placeholder="<{$data.interest}>"></textarea>
							<div class="rq mtn" id="showerror_interest">
							</div>
							<p class="d">
							</p>
						</td>
					</tr>

					<tr>
						<th id="th_sightml" class="profile_item">
							个人签名
						</th>
						<td id="td_sightml">
							<div class="tedt">
								
								<div class="area">
									<textarea rows="3" cols="80" name="sightml" placeholder="<{$data.interest}>" id="sightmlmessage" class="pt" onkeydown="ctrlEnter(event, 'profilesubmitbtn');"></textarea>
								</div>
							
							
						</td>
					</tr>
					<tr>
						<th>
							 
						</th>
						<td colspan="2">
							<input name="uid" value="<{$_GET['uid']}>" type="hidden">
							<button name="profilesubmitbtn" id="profilesubmitbtn" class="pn3"><img src="__PUBLIC__/Home/image/space/home_save_btn.png"></button>
							<span id="submit_result" class="rq"></span>
						</td>
					</tr>
					</tbody>
					</table>
				</form>
			</div>
		</div>
		<div class="appl">
			<div class="tbn miui_spacecp">
				<h2 class="mt bbda">设置</h2>
				<ul>
					<li>
					<span style="background-position-x: 0px;"></span>
					<a href="http://www.miui.com/home.php?mod=spacecp&ac=avatar">修改头像</a>
					</li>
					<li class="a"><span style="background-position-x: -13px;"></span><a href="http://www.miui.com/home.php?mod=spacecp&ac=profile">个人资料</a></li>
					<li><a href="http://www.miui.com/home.php?mod=spacecp&ac=credit"><span style="background-position-x: -26px;"></span>积分</a></li>
					<li><a href="http://www.miui.com/home.php?mod=spacecp&ac=profile&op=password"><span style="background-position-x: -83px;"></span>密码安全</a></li>
				</ul>
			</div>
		</div>
	</div>
</div>
</block>